package com.coke.demo.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 19602
 */
@Component
public interface CourseTimeMapper {

    /**
     * 根据实验室id查询实验室每天具体开放时间
     *
     * @param labId 实验室id
     * @return Time
     */
    @Select("select courseTime from courseTime where labId=#{labId}")
    List<String> findTimeByLabId(Integer labId);

    /**
     * 根据日期查询实验室名称
     *
     * @param day 周一 至 周日
     * @param time 上课时间
     * @return List<String>
     */
    @Select("select labname from labinfo where labid in (select labid from coursetime where OpenDay = #{day} and CourseTime = #{time});")
    List<String> findLabNameByTime(Integer day , String time);
}
